import Vue from "vue";
import Vuex from 'vuex';

Vue.use(Vuex);

export default new Vuex.Store({
	state:{
		topListIds:[],
		nextId: ''
	},
	mutations:{
		INIT_TOPLISTIDS(state,data){
			state.topListIds = data;
		},
		NEXT_ID(state,data){
			for(let i=0;i<state.topListIds.length;i++) {
				if(state.topListIds[i].id === data) {
					state.nextId = state.topListIds[i+1].id
				}
			}
		}
	},
	
})